﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Security.Cryptography;
using System.Text;
using System.Threading.Tasks;

namespace SimpleORM.Model.SYSModel
{
    public class RSASecretKey
    {

        public string PublicKey { get; set; }
        public string PrivateKey { get; set; }

        public RSASecretKey GenerateRSASecretKey()
        {
            RSASecretKey rsaKey = new();
            using (RSACryptoServiceProvider rsa = new(4096))
            {
                rsaKey.PrivateKey = rsa.ToXmlString(true);
                rsaKey.PublicKey = rsa.ToXmlString(false);
            }
            return rsaKey;
        }
    }
}
